package com.legsem.legstar.cci;

import javax.resource.cci.Connection;

import com.legsem.legstar.jca.LegStarManagedConnection;

/**
 * The CCI connection hides the managed connection.
 * 
 */
public interface LegStarConnection extends Connection {

    /**
     * The underlying managed connection.
     * 
     * @return the underlying managed connection
     */
    public LegStarManagedConnection getManagedConnection();

    /**
     * The underlying managed connection.
     * 
     * @param managedConnection the underlying managed connection
     */
    public void setManagedConnection(LegStarManagedConnection managedConnection);

    /**
     * Mark this connection as invalid.
     */
    public void invalidate();

    /**
     * True if the connection is still valid.
     * 
     * @return false if connection was invalidated
     */
    public boolean isValid();

}
